/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1598367467836_5237';

  // add your middleware config here 中间件
  config.middleware = ['check'];
  // 服务器运行在哪个端口
  config.cluster = {
    listen: {
      path: '',
      port: 3001,
      hostname: '127.0.0.1',
    }
  }
  // 配置jwt token验证
  config.check = {  //jwt配置项
    secret: "123456"
  }
  // 关闭csrf验证
  config.security = {
    csrf: {
      enable: false
    }
  }
  config.mongoose = {
    client: {
      url: 'mongodb://127.0.0.1/jz_wxapp',
      options: {
        useNewUrlParser: true,
        useUnifiedTopology: true
      },
    }
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
